Open Traffic Generator API (0.10.11)

Download OpenAPI specification:Download

Open Traffic Generator API defines a model-driven, vendor-neutral and standard interface for emulating layer 2-7 network devices and generating test traffic.

Contributions can be made in the following ways:

Configuration

set_config

Sets configuration resources on the traffic generator.

Request Body schema: application/json
Array of objects (Port)

The ports that will be configured on the traffic generator.

Array of objects (Lag)

The LAGs that will be configured on the traffic generator.

Array of objects (Layer1)

The layer1 settings that will be configured on the traffic generator.

Array of objects (Capture)

The capture settings that will be configured on the traffic generator.

Array of objects (Device)

The emulated devices that will be configured on the traffic generator. Each device contains configurations for network interfaces and protocols running on top of those interfaces.

Array of objects (Flow)

The flows that will be configured on the traffic generator.

object (Event)

The optional container for event configuration.

object (Config.Options)

Global configuration options.

Array of objects (Lldp)

LLDP protocol that will be configured on traffic generator.

Responses

Request samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    },
  • "lldp": [
    ]
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

get_config

Responses

Response samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    },
  • "lldp": [
    ]
}

update_config

Updates specific attributes of resources configured on the traffic generator. The fetched configuration shall reflect the updates applied successfully. The Response.Warnings in the Success response is available for implementers to disclose additional information about a state change including any implicit changes that are outside the scope of the state change.

Request Body schema: application/json
choice
string
Value: "flows"
object (Flows.Update)

A container of flows with associated properties to be updated without affecting the flows current transmit state.

Responses

Request samples

Content type
application/json
{
  • "choice": "flows",
  • "flows": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

Control

set_control_state

Sets the state of resources configured on the traffic generator. The Response.Warnings in the Success response is available for implementers to disclose additional information about a state change including any implicit changes that are outside the scope of the state change.

Request Body schema: application/json
choice
required
string
Enum: "flow_transmit" "protocol" "route" "port_link" "port_capture" "lacp"
object (Control.Flow.Transmit)

Sets the transmit state of configured flows.

object (Control.Protocol)

Sets all configured protocols to start or stop state. Setting protocol state to start shall be a no-op if preceding set_config API call was made with config.options.protocol_options.auto_start_all set to true or if all the configured protocols are already started.

object (Control.Route)

Sets the state of configured routes

object (Control.Port.Link)

Port link state.

object (Control.Port.Capture)

Sets the capture state of configured ports

Responses

Request samples

Content type
application/json
{
  • "choice": "flow_transmit",
  • "flow_transmit": {
    },
  • "protocol": {
    },
  • "route": {
    },
  • "port_link": {
    },
  • "port_capture": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

set_control_action

Triggers action on the resources configured on the traffic generator.

Request Body schema: application/json
choice
required
string
Value: "ping"
object (Ping.Request)

Ping request details

Responses

Request samples

Content type
application/json
{
  • "choice": "ping",
  • "ping": {
    }
}

Response samples

Content type
application/json
{
  • "choice": "ping",
  • "ping": {
    }
}

set_transmit_state

Status: {'status': 'deprecated', 'information': 'Please use set_control_state with flow_transmit choice instead'} Updates the state of configuration resources on the traffic generator. The Response.Warnings in the Success response is available for implementers to disclose additional information about a state change including any implicit changes that are outside the scope of the state change.

Request Body schema: application/json
flow_names
Array of strings

The names of flows to which the transmit state will be applied to. If the list of flow_names is empty or null the state will be applied to all configured flows. If the list is not empty any flow that is not included in the list of flow_names MUST be ignored and not included in the state change.

x-constraint:

  • /components/schemas/Flow/properties/name
state
required
string
Enum: "start" "stop" "pause" "resume"

The transmit state. If the value of the state property is 'start' then all flows defined by the 'flow_names' property will be started and the metric counters MUST be cleared prior to starting the flow(s). If the value of the state property is 'stop' then all flows defined by the 'flow_names' property will be stopped and the metric counters MUST NOT be cleared. If the value of the state property is 'pause' then all flows defined by the 'flow_names' property will be paused and the metric counters MUST NOT be cleared. If the value of the state property is 'resume' then any paused flows defined by the 'flow_names' property will start transmit at the point at which they were paused. Any flow that is stopped will start transmit at the beginning of the flow. The flow(s) MUST NOT have their metric counters cleared.

Responses

Request samples

Content type
application/json
{
  • "flow_names": [
    ],
  • "state": "start"
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

set_capture_state

Status: {'status': 'deprecated', 'information': 'Please use set_control_state with port_capture choice instead'} Updates the state of configuration resources on the traffic generator.

Request Body schema: application/json
port_names
Array of strings

The names of ports to which the capture state will be applied to. If the list of port_names is empty or null the state will be applied to all configured ports. If the list is not empty any port that is not included in the list of port_names MUST be ignored and not included in the state change.

x-constraint:

  • /components/schemas/Port/properties/name
state
required
string
Enum: "start" "stop"

The capture state.

Responses

Request samples

Content type
application/json
{
  • "port_names": [
    ],
  • "state": "start"
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

update_flows

Status: {'status': 'deprecated', 'information': 'Please use update_config with flow choice instead'} Updates flow properties without disruption of transmit state.

Request Body schema: application/json
property_names
required
Array of strings
Items Enum: "rate" "size"

Flow properties to be updated without affecting the transmit state.

required
Array of objects (Flow)

The list of configured flows for which given property will be updated.

Responses

Request samples

Content type
application/json
{
  • "property_names": [
    ],
  • "flows": [
    ]
}

Response samples

Content type
application/json
{
  • "ports": [
    ],
  • "lags": [
    ],
  • "layer1": [
    ],
  • "captures": [
    ],
  • "devices": [
    ],
  • "flows": [
    ],
  • "events": {
    },
  • "options": {
    },
  • "lldp": [
    ]
}

set_route_state

Status: {'status': 'deprecated', 'information': 'Please use set_control_state with route choice instead'} Updates the state of configuration resources on the traffic generator.

Request Body schema: application/json
names
Array of strings

The names of device route objects to control. If no names are specified then all route objects that match the x-constraint will be affected.

x-constraint:

  • /components/schemas/Bgp.V4RouteRange/properties/name
  • /components/schemas/Bgp.V6RouteRange/properties/name
  • /components/schemas/Isis.V4RouteRange/properties/name
  • /components/schemas/Isis.V6RouteRange/properties/name
state
required
string
Enum: "withdraw" "advertise"

Route specific states

Responses

Request samples

Content type
application/json
{
  • "names": [
    ],
  • "state": "withdraw"
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

send_ping

Status: {'status': 'deprecated', 'information': 'Please use set_control_action with ping choice instead'} API to send an IPv4 and/or IPv6 ICMP Echo Request(s) between endpoints. For each endpoint 1 ping packet will be sent and API shall wait for ping response to either be successful or timeout. The API wait timeout for each request is 300ms.

Request Body schema: application/json
Array of objects (Ping)

Array of ping requests

Responses

Request samples

Content type
application/json
{
  • "endpoints": [
    ]
}

Response samples

Content type
application/json
{
  • "responses": [
    ]
}

set_protocol_state

Status: {'status': 'deprecated', 'information': 'Please use set_control_state with protocol choice instead'} Sets all configured protocols to start or stop state.

Request Body schema: application/json
state
required
string
Enum: "start" "stop"

Protocol specific states

Responses

Request samples

Content type
application/json
{
  • "state": "start"
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

set_device_state

Status: {'status': 'deprecated', 'information': 'Please use set_control_state with device choice instead'} Set specific state/actions on device configuration resources on the traffic generator.

Request Body schema: application/json
choice
string
Value: "lacp_member_state"
object (LacpMember.State)

Set LACP state for specified LAG Member Port(s).

Responses

Request samples

Content type
application/json
{
  • "choice": "lacp_member_state",
  • "lacp_member_state": {
    }
}

Response samples

Content type
application/json
{
  • "warnings": [
    ]
}

Monitor

get_metrics

Request Body schema: application/json

Request to traffic generator for metrics of choice

choice
string
Default: "port"
Enum: "port" "flow" "bgpv4" "bgpv6" "isis" "lag" "lacp" "lldp" "rsvp"
object (Port.Metrics.Request)

The port result request to the traffic generator

object (Flow.Metrics.Request)

The container for a flow metric request.

object (Bgpv4.Metrics.Request)

The request to retrieve BGPv4 per peer metrics/statistics.

object (Bgpv6.Metrics.Request)

The request to retrieve BGPv6 per peer metrics/statistics.

object (Isis.Metrics.Request)

The request to retrieve ISIS per Router metrics/statistics.

object (Lag.Metrics.Request)

The request to retrieve per LAG metrics/statistics.

object (Lacp.Metrics.Request)

The request to retrieve LACP per LAG member metrics/statistics.

object (Lldp.Metrics.Request)

The request to retrieve LLDP per instance metrics/statistics.

object (Rsvp.Metrics.Request)

The request to retrieve RSVP-TE per Router metrics/statistics.

Responses

Request samples

Content type
application/json
{
  • "choice": "port",
  • "port": {
    },
  • "flow": {
    },
  • "bgpv4": {
    },
  • "bgpv6": {
    },
  • "isis": {
    },
  • "lag": {
    },
  • "lacp": {
    },
  • "lldp": {
    },
  • "rsvp": {
    }
}

Response samples

Content type
application/json
{
  • "choice": "port_metrics",
  • "port_metrics": [
    ],
  • "flow_metrics": [
    ],
  • "bgpv4_metrics": [
    ],
  • "bgpv6_metrics": [
    ],
  • "isis_metrics": [
    ],
  • "lag_metrics": [
    ],
  • "lacp_metrics": [
    ],
  • "lldp_metrics": [
    ],
  • "rsvp_metrics": [
    ]
}

get_states

Request Body schema: application/json

Request to traffic generator for states of choice

choice
string
Default: "ipv4_neighbors"
Enum: "ipv4_neighbors" "ipv6_neighbors" "bgp_prefixes" "isis_lsps" "lldp_neighbors" "rsvp_lsps"
object (Neighborsv4.States.Request)

The request to retrieve IPv4 Neighbor state (ARP cache entries) of a network interface(s).

object (Neighborsv6.States.Request)

The request to retrieve IPv6 Neighbor state (NDISC cache entries) of a network interface(s).

object (BgpPrefix.State.Request)

The request to retrieve BGP peer prefix information.

object (IsisLsps.State.Request)

The request to retrieve ISIS Link State PDU (LSP) information learned by the router.

object (LldpNeighbors.State.Request)

The request to retrieve LLDP neighbor information for a given instance.

object (RsvpLsps.State.Request)

The request to retrieve RSVP Label Switched Path (LSP) information learned by the router.

Responses

Request samples

Content type
application/json
{
  • "choice": "ipv4_neighbors",
  • "ipv4_neighbors": {
    },
  • "ipv6_neighbors": {
    },
  • "bgp_prefixes": {
    },
  • "isis_lsps": {
    },
  • "lldp_neighbors": {
    },
  • "rsvp_lsps": {
    }
}

Response samples

Content type
application/json
{
  • "choice": "ipv4_neighbors",
  • "ipv4_neighbors": [
    ],
  • "ipv6_neighbors": [
    ],
  • "bgp_prefixes": [
    ],
  • "isis_lsps": [
    ],
  • "lldp_neighbors": [
    ],
  • "rsvp_lsps": [
    ]
}

get_capture

Request Body schema: application/json

Capture results request to the traffic generator.

port_name
required
string

The name of a port a capture is started on.

x-constraint:

  • /components/schemas/Port/properties/name

Responses

Request samples

Content type
application/json
{
  • "port_name": "string"
}

Response samples

Content type
application/json
{
  • "errors": [
    ]
}

Capabilities

get_version

Responses

Response samples

Content type
application/json
{
  • "api_spec_version": "",
  • "sdk_version": "",
  • "app_version": ""
}